{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
}}

{{#if this.hasGenerated}}
  <DetailsCredentials @credentials={{@credentials}} @onRevokeCredentials={{this.revokeCredentials}} />
{{else}}
  <EditForm
    @model={{@credentials}}
    @onSave={{fn (mut this.hasGenerated) true}}
    @callOnSaveAfterRender={{true}}
    @successMessage="Successfully generated credentials from role: {{@credentials.role}}!"
    @cancelLinkParams={{array "credentials.index"}}
  />
{{/if}}